#include "../macro.h"
#include <iostream>
#include <pthread.h>

using std::cout;
using std::endl;

void *func(void *parm)
{
    printf("child thread %ld\n", pthread_self());  
}

int main(int args, char *argv[])
{
    pthread_t thid;
    int ret = pthread_create(&thid, nullptr, func, nullptr);
    PTHREAD_ERR_CHECK(ret, 0, "pthread_create")
    printf("main thread %ld\n", pthread_self());

    pthread_join(thid, nullptr);
    return 0;
}